@import 'https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.css';
@tailwind base;
@tailwind components;
@tailwind utilities;

/* 企业级基础样式 */
@layer base {
  html {
    scroll-behavior: smooth;
  }

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #374151;
    line-height: 1.6;
    background-color: #ffffff;
  }
}

/* 动画关键帧 */
@keyframes floating {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
  }
}

@keyframes slide-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounce-gentle {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

@keyframes fade-in-out {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.6;
  }
}

/* 企业级组件样式 */
@layer components {
  /* 现代化渐变背景 */
  .hero-gradient {
    background: linear-gradient(-45deg, #f8fafc, #f1f5f9, #e2e8f0, #cbd5e1);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
    position: relative;
  }

  /* 品牌色渐变背景 */
  .brand-gradient {
    background: linear-gradient(-45deg, #3b82f6, #1d4ed8, #6366f1, #8b5cf6);
    background-size: 400% 400%;
    animation: gradient-shift 20s ease infinite;
    position: relative;
  }

  /* 现代玻璃拟态效果 */
  .glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  }

  .glass-morphism {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  }

  /* 卡片阴影效果 */
  .card-shadow {
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.8);
  }

  .card-shadow-lg {
    background: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(229, 231, 235, 0.8);
  }

  /* 现代滚动条样式 */
  * {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
  }

  *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  *::-webkit-scrollbar-track {
    background: rgba(243, 244, 246, 0.5);
    border-radius: 4px;
  }

  *::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.6);
    border-radius: 4px;
    border: 1px solid rgba(243, 244, 246, 0.8);
    transition: all 0.3s ease;
  }

  *::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 126, 0.8);
    box-shadow: 0 2px 8px rgba(107, 114, 126, 0.2);
  }

  *::-webkit-scrollbar-corner {
    background: transparent;
  }

  /* 浮动动画 */
  .floating {
    animation: floating 6s ease-in-out infinite;
  }

  /* 现代文本渐变 */
  .text-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .text-gradient-brand {
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 50%, #db2777 100%);
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  /* 卡片悬浮效果 */
  .card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slide-in-up 0.6s ease-out;
  }

  .card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  }

  /* 现代按钮样式 */
  .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    border: none;
    color: white;
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  }

  .btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 4px 15px rgba(107, 114, 126, 0.3);
    transition: all 0.3s ease;
    border: none;
    color: white;
  }

  .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 126, 0.4);
  }

  .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  }

  .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  }

  /* 现代价格标签 */
  .price-tag {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    color: white;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
  }

  /* 品牌标识 */
  .brand-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
  }

  /* 状态标签 */
  .status-badge-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
  }

  .status-badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
  }

  .status-badge-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
  }

  /* 现代卡片样式 */
  .modern-card {
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .modern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }

  /* 网格布局 */
  .masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
  }

  .masonry-item {
    animation: slide-in-up 0.6s ease-out;
    animation-fill-mode: both;
  }

  .masonry-item:nth-child(odd) {
    animation-name: slide-in-left;
    animation-delay: 0.1s;
  }

  .masonry-item:nth-child(even) {
    animation-name: slide-in-right;
    animation-delay: 0.2s;
  }

  /* 现代筛选按钮 */
  .filter-btn {
    @apply px-4 py-2 bg-white border border-gray-200 text-gray-700 rounded-xl font-medium transition-all duration-300 hover:bg-blue-50 hover:border-blue-300 hover:text-blue-700 shadow-sm;
  }

  .active-filter-btn {
    @apply bg-gradient-to-r from-blue-500 to-purple-600 text-white border-transparent shadow-lg;
    animation: pulse-glow 2s infinite;
  }

  /* 文本截断 */
  .line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }
  
  .line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  
  .line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  /* 专业导航样式 */
  .nav-link {
    @apply text-gray-600 hover:text-blue-600 transition-colors duration-200 font-medium;
  }

  /* 企业级卡片样式 */
  .enterprise-card {
    @apply bg-white rounded-xl border border-gray-200 shadow-sm hover:shadow-lg transition-all duration-300;
  }

  /* 表单控件样式 */
  .form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm bg-white transition-all duration-200;
  }
  
  .form-select {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm bg-white transition-all duration-200;
  }

  /* 现代标签样式 */
  .badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs font-medium;
  }
  
  .badge-gray {
    @apply bg-gray-100 text-gray-800 border border-gray-200;
  }
  
  .badge-blue {
    @apply bg-blue-50 text-blue-700 border border-blue-200;
  }
  
  .badge-green {
    @apply bg-green-50 text-green-700 border border-green-200;
  }
  
  .badge-red {
    @apply bg-red-50 text-red-700 border border-red-200;
  }
  
  .badge-orange {
    @apply bg-orange-50 text-orange-700 border border-orange-200;
  }

  /* 规格显示样式 */
  .spec-item {
    @apply flex justify-between items-center py-3 text-sm border-b border-gray-100 last:border-b-0;
  }
  
  .spec-label {
    @apply text-gray-600 font-medium;
  }
  
  .spec-value {
    @apply font-semibold text-gray-900 text-right;
  }

  /* 评分星级样式 */
  .rating-stars {
    @apply flex items-center gap-1;
  }
  
  .rating-star {
    @apply text-yellow-400;
  }
  
  .rating-star-empty {
    @apply text-gray-300;
  }

  /* 价格显示样式 */
  .price-primary {
    @apply text-2xl font-bold text-blue-600;
  }
  
  .price-secondary {
    @apply text-sm text-gray-500 line-through;
  }

  /* 状态指示器 */
  .status-success {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-green-50 text-green-700 border border-green-200;
  }
  
  .status-warning {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-orange-50 text-orange-700 border border-orange-200;
  }
  
  .status-error {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-red-50 text-red-700 border border-red-200;
  }

  /* 分隔线样式 */
  .divider {
    @apply border-t border-gray-200;
  }

  /* 加载状态 */
  .loading-spinner {
    @apply w-8 h-8 border-4 border-blue-600 border-t-transparent rounded-full animate-spin;
  }

  /* 空状态样式 */
  .empty-state {
    @apply text-center py-16;
  }
  
  .empty-state-icon {
    @apply text-6xl text-gray-400 mb-6;
  }
  
  .empty-state-title {
    @apply text-xl font-semibold text-gray-900 mb-4;
  }
  
  .empty-state-description {
    @apply text-gray-600 mb-6;
  }

  /* 响应式布局 */
  .container-responsive {
    @apply container mx-auto px-6;
  }

  /* 阴影层级 */
  .shadow-soft {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  }
  
  .shadow-medium {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }

  .shadow-large {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }

  /* 过渡动画 */
  .transition-base {
    @apply transition-all duration-200 ease-in-out;
  }

  /* 企业级头部样式 */
  .page-header {
    @apply bg-white border-b border-gray-200 shadow-sm;
  }
  
  .page-title {
    @apply text-3xl font-bold text-gray-900;
  }
  
  .page-subtitle {
    @apply text-gray-600 mt-2;
  }

  /* 面包屑导航 */
  .breadcrumb {
    @apply flex items-center text-sm text-gray-500;
  }
  
  .breadcrumb-item {
    @apply hover:text-blue-600 transition-colors duration-200;
  }
  
  .breadcrumb-separator {
    @apply mx-2;
  }

  /* 侧边栏样式 */
  .sidebar {
    @apply bg-white rounded-xl border border-gray-200 shadow-sm;
  }
  
  .sidebar-section {
    @apply p-6 border-b border-gray-200 last:border-b-0;
  }
  
  .sidebar-title {
    @apply text-lg font-semibold text-gray-900 mb-4;
  }

  /* 工具栏样式 */
  .toolbar {
    @apply bg-white rounded-xl border border-gray-200 shadow-sm;
  }
  
  .toolbar-content {
    @apply px-6 py-4 flex items-center justify-between border-b border-gray-200;
  }

  /* 网格布局 */
  .product-grid {
    @apply grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6;
  }

  /* 产品卡片样式 */
  .product-card {
    @apply bg-white rounded-xl border border-gray-200 shadow-sm hover:shadow-lg transition-all duration-300;
  }
  
  .product-image {
    @apply relative h-48 bg-gray-50 border-b border-gray-200 rounded-t-xl overflow-hidden;
  }
  
  .product-content {
    @apply p-6;
  }
  
  .product-title {
    @apply font-semibold text-gray-900 text-lg leading-tight mb-2 line-clamp-2;
  }
  
  .product-description {
    @apply text-gray-600 text-sm leading-relaxed line-clamp-2;
  }

  /* 详情页样式 */
  .detail-section {
    @apply bg-white rounded-xl border border-gray-200 shadow-sm mb-8;
  }
  
  .detail-header {
    @apply px-8 py-6 border-b border-gray-200;
  }
  
  .detail-content {
    @apply p-8;
  }
  
  .detail-title {
    @apply text-2xl font-bold text-gray-900 flex items-center gap-3;
  }
}

/* 企业级工具类 */
@layer utilities {
  /* 焦点状态 */
  .focus-visible {
    @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2;
  }

  /* 交互状态 */
  .interactive {
    @apply cursor-pointer select-none;
  }

  /* 禁用状态 */
  .disabled {
    @apply opacity-50 cursor-not-allowed;
  }

  /* 文本颜色 */
  .text-primary {
    @apply text-gray-900;
  }
  
  .text-secondary {
    @apply text-gray-600;
  }
  
  .text-muted {
    @apply text-gray-500;
  }

  /* 背景颜色 */
  .bg-surface {
    @apply bg-white;
  }
  
  .bg-muted {
    @apply bg-gray-50;
  }

  /* 边框 */
  .border-standard {
    @apply border border-gray-200;
  }
  
  .border-strong {
    @apply border border-gray-300;
  }

  /* 动画延迟 */
  .animation-delay-100 {
    animation-delay: 0.1s;
  }
  
  .animation-delay-200 {
    animation-delay: 0.2s;
  }
  
  .animation-delay-300 {
    animation-delay: 0.3s;
  }
}

/* 自定义动画 */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 动画类 */
.animate-spin-slow {
  animation: spin-slow 20s linear infinite;
}

.animate-fade-in {
  animation: fade-in 0.6s ease-out;
}

.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out;
}

.animate-scale-in {
  animation: scale-in 0.3s ease-out;
}

.animate-bounce-gentle {
  animation: bounce-gentle 2s infinite;
}

/* 动画延迟类 */
.delay-1000 {
  animation-delay: 1000ms;
}

.delay-500 {
  animation-delay: 500ms;
}

.delay-200 {
  animation-delay: 200ms;
}

.delay-300 {
  animation-delay: 300ms;
}

.delay-400 {
  animation-delay: 400ms;
} 